<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Document</title>
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
  <meta name="description" content="Description">
  <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
  <meta HTTP-EQUIV="pragma" CONTENT="no-cache">
  <meta HTTP-EQUIV="Cache-Control" CONTENT="no-store, must-revalidate">
  <meta HTTP-EQUIV="expires" CONTENT="Wed, 26 Feb 1997 08:21:57 GMT">
  <meta HTTP-EQUIV="expires" CONTENT="0">
  <link rel="stylesheet" href="Css/vue.css">
  <link rel="icon" href="./Images/logo.png" sizes="32x32">
  <style>
    version {
      display: block;
      text-align: center;
      color: #42b983;
    }
    version select {
      width: 63px;
      height: 22px;
      border: 1px solid #42b983;
      color: #42b983;
      border-radius: 5px;
      position: relative;
      top: -2px;
    }
    .app-nav {
      right: 20px;
    }
  </style>
</head>
<body>
  <nav>
    <version>
      文档版本：
      <select id="docVersion" name="docVersion" onchange="docVersionFn(this)">
        <option value="v2">v2.*.*</option>
        <option value="v1" selected>v1.*.*</option>
        <option value="v0">v1.0</option>
      </select>
    </version>
  </nav>
  <div id="app"></div>
  <script>
    window.$docsify = {
      name: 'SimpleMemory',
      requestHeaders: {
        'cache-control': 'no-cache'
      },
      repo: 'https://github.com/BNDong/Cnblogs-Theme-SimpleMemory',
      loadSidebar: true,
      subMaxLevel: 3,
      maxLevel: 5,
      noEmoji: true,
      // logo: "/Images/logo.png",

      search: {
        noData: {
          '/': '没有结果'
        },
        paths: 'auto',
        placeholder: {
          '/': '搜索'
        }
      },
    }
  </script>
  <script src="Js/docsify.min.js"></script>
  <script src="Js/search.min.js"></script>
  <script>
    function docVersionFn(e) {
          let origin   = location.origin;
          let pathname = location.pathname;
          let pathnameArr = pathname.split('/');
          for (let i = pathnameArr.length - 1; i >= 0; i--) {
            if (pathnameArr[i] !== "" && /v[0-9]{1}/.test(pathnameArr[i])) {
              pathnameArr[i] = e.value;
              break;
            }
          }
          window.location.href = origin + pathnameArr.join('/');
    }
  </script>
</body>
</html>
